package cn.org.xuanzp.accept.provider.impl;

import cn.hutool.json.JSONUtil;
import cn.org.xuanzp.accept.provider.AcceptProvider;
import cn.org.xuanzp.common.command.impl.LoginCommand;
import cn.org.xuanzp.common.command.impl.LoginoutCommand;

/**
 * @Classname LoginProvider
 * @Description TODO
 * @Version 1.0.0
 * @Date 2024/9/25 23:03
 * @Created by xuanzp
 */
public class LoginoutProvider implements AcceptProvider<LoginoutCommand> {
    /***
     * 接受消息
     * @param loginCommand
     */
    @Override
    public void accept(LoginoutCommand loginoutCommand) {
        if(support(loginoutCommand)){
            System.out.println("loginoutCommand = " + JSONUtil.toJsonStr(loginoutCommand));
        }
    }

    /***
     * 判断是否支持
     * @param o
     * @return
     */
    @Override
    public Boolean support(Object o) {
        return o instanceof LoginoutCommand;
    }
}
